-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create v6 HelpBox with Styled System #414
Conversation
Using Styled System's theme and variant APIs.
Removes the custom 'validateVariantSelection' function.
Oops, I just realized that there's a /**
* Chooses the correct variant from a main variant prop and a set of boolean shortcut props.
*
* @param {string|undefined} variant - The value of the component's `variant` prop.
* @param {{ [propName: string]: boolean }} shortcutProps - An object of shortcut prop names and boolean values, the names corresponding to variant name options.
* @returns {string|null} The name of the selected variant (or `null` if no variant has been selected).
*/ The one thing my |
I didn't add anything about the new |
Beautiful 👍
Glad we can keep using that one 👍
Looks beautiful 👍
I'm not overly concerned about that scenario.
I was about to say let's remove them... but I don't feel strongly enough to do so. I'm fine to keep them. We can always deprecate them for v7 if we feel the need. |
Onward #378!
HelpBox
had previously been using a legacytheme
prop and a homespun variant API, so I replaced those with our Styled System global theme and Styled System's variant API.I created a
variant
prop for these variants but also kept theprimary
,success
,danger
,warning
, andminor
props as shortcuts, and I added a perhaps somewhat convoluted function calledvalidateVariantSelection
to handle conflicts between those props if they're used incorrectly. Let me know if I should remove those shortcut props.Also, should I enable any regular Styled System categories for this component? None are enabled currently.